package bsts.model;

import java.util.ArrayList;
import java.util.Date;
import java.io.*;
//Modify by Than Htet Aung-A0079950R : 26-March-2011 (implement comparable), remove unnecessary attributes
public class Bill implements Comparable<Bill> ,Serializable{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	//Bill no will be [accountno+_bill+year+month in two digit]
	private String billNo;
	private Date billDate;
	private Date dueDate;
	private User billByUser;
	private double balance;
	private Account account;		

	public Bill(String billNo, Date billDate, Date dueDate, User billByUser,double balance, Account account) {
		this.billNo = billNo;
		this.billDate = billDate;
		this.dueDate = dueDate;
		this.billByUser = billByUser;
		this.account = account;
		this.balance = balance;
	}

	public double getBalance() {
		return balance;
	}

	public void setBalance(double balance) {
		this.balance = balance;
	}

	public String getBillNo() {
		return billNo;
	}

	public void setBillNo(String billNo) {
		this.billNo = billNo;
	}

	public Date getBillDate() {
		return billDate;
	}

	public void setBillDate(Date billDate) {
		this.billDate = billDate;
	}

	public Date getDueDate() {
		return dueDate;
	}

	public void setDueDate(Date dueDate) {
		this.dueDate = dueDate;
	}

	public User getBillByUser() {
		return billByUser;
	}

	public void setBillByUser(User billByUser) {
		this.billByUser = billByUser;
	}
	
	public ArrayList<Payment> getPayments() {
		return new ArrayList<Payment>();
	}
	
	public Account getAccount() {
		return account;
	}

	public void setAccount(Account account) {
		this.account = account;
	}
	
	public int compareTo(Bill other){
		return (getBillDate().compareTo(other.getBillDate()));
	}
}
